package com.share.device.service.impl;

import java.util.List;
import com.share.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.share.device.mapper.StationMapper;
import com.share.device.domain.Station;
import com.share.device.service.IStationService;

/**
 * 站点Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-24
 */
@Service
public class StationServiceImpl implements IStationService 
{
    @Autowired
    private StationMapper stationMapper;

    /**
     * 查询站点
     * 
     * @param id 站点主键
     * @return 站点
     */
    @Override
    public Station selectStationById(Long id)
    {
        return stationMapper.selectStationById(id);
    }

    /**
     * 查询站点列表
     * 
     * @param station 站点
     * @return 站点
     */
    @Override
    public List<Station> selectStationList(Station station)
    {
        return stationMapper.selectStationList(station);
    }

    /**
     * 新增站点
     * 
     * @param station 站点
     * @return 结果
     */
    @Override
    public int insertStation(Station station)
    {
        station.setCreateTime(DateUtils.getNowDate());
        return stationMapper.insertStation(station);
    }

    /**
     * 修改站点
     * 
     * @param station 站点
     * @return 结果
     */
    @Override
    public int updateStation(Station station)
    {
        station.setUpdateTime(DateUtils.getNowDate());
        return stationMapper.updateStation(station);
    }

    /**
     * 批量删除站点
     * 
     * @param ids 需要删除的站点主键
     * @return 结果
     */
    @Override
    public int deleteStationByIds(Long[] ids)
    {
        return stationMapper.deleteStationByIds(ids);
    }

    /**
     * 删除站点信息
     * 
     * @param id 站点主键
     * @return 结果
     */
    @Override
    public int deleteStationById(Long id)
    {
        return stationMapper.deleteStationById(id);
    }
}
